//
//  CustomButton.m
//  JunZheng
//
//  Created by Sunshine on 2018/3/1.
//  Copyright © 2018年 Sunshine. All rights reserved.
//

#import "CustomButton.h"

@implementation CustomButton

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.mytitLabel = [UILabel new];
        self.mytitLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.mytitLabel];
        self.mytitLabel.sd_layout
        .centerXEqualToView(self)
        .centerYEqualToView(self)
        .heightIs(self.height)
        .widthIs(self.width/2);
        
        
        
        self.mynum = [UILabel new];
        self.mynum.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.mynum];
        self.mynum.sd_layout
        .centerYEqualToView(self.mytitLabel)
        .leftSpaceToView(self.mytitLabel, 0)
        .heightIs(15*kJLXWidthScale)
        .widthIs(15*kJLXWidthScale);
        self.mynum.layer.masksToBounds = YES;
        self.mynum.layer.cornerRadius = self.mynum.width/2;
        
        self.btn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self addSubview:self.btn];
        self.btn.sd_layout
        .centerYEqualToView(self.mytitLabel)
        .rightSpaceToView(self, 5*kJLXWidthScale)
        .heightIs(30*kJLXWidthScale)
        .widthIs(30*kJLXWidthScale);
        
    }
    return self;
}





/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
